//返回值为需不需要关闭窗口
function yesOperator(){
    console.log("====yesOperator=====");
    var retValue=addData();
    return retValue;
}
function updateLoad(){
    var params = $$.getQueryString();
    $$.ajax({
        url:"/rest/IotReportCatalogBusiness/query",
        data : {
            id : params.rowId
        },
        success : function(data){
            $("#b_id").val(data.id);
            $("#b_pid").val(data.pid);

            $("#b_catalogName").val(data.catalogName);

            $("#b_level").val(data.level);

            $("#b_isLeaf").val(data.isLeaf);

            $("#b_status").val(data.status);

            $("#b_rowSort").val(data.rowSort);

            $("#b_remarks").val(data.remarks);


            var status=data.status;

            $("input[name^='b_status_']").each(function(){
                if($(this).val()==status){
                    this.checked='checked';
                }
            });







        }
    });



}
function addData(){
    console.log("====addData=====");
    var param = {};
    var validFormRet;
    $$.form({
        async:false,
        able:function(){
            validFormRet=false;
        },
        checkForm: validForm,
        success: function () {
            validFormRet= true;
        }
    });
    return validFormRet;
}
function validForm(){
    return $('#theform').valid() ;
}
$(function () {
    classifyFormValid();
});
//验证信息
function classifyFormValid() {
    $("#theform").validate({
        rules: {
            b_catalogName: {
                required: true
            }
        },
        errorPlacement: function(error, element) {
            error.appendTo(element.parent());
        },
        errorElement: "span",
        errorClass: "errortips",
        success: 'valid',
        messages: {
            b_catalogName: {
                required: " (必填)"
            }
        }
    });
}
function submitForm() {
    if($('#theform').valid()){
        return false;
    }
    return {};
}
